home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 11337 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: solon.com!not-for-mail
  2. From: "Reed R. Mangino" <mangino@planet.net>
  3. Newsgroups: comp.lang.c,comp.lang.c.moderated
  4. Subject: const pointer confusion...
  5. Date: 23 Mar 1996 00:42:30 -0600
  6. Organization: Dialogic Corporation
  7. Sender: clc@solutions.solon.com
  8. Approved: clc@solutions.solon.com
  9. Message-ID: <4j06gm$7oa@solutions.solon.com>
  10. NNTP-Posting-Host: solutions.solon.com
  11. X-Mailer: Mozilla 2.0GoldB1 (Win95; I)
  12.  
  13. Could someone please straighten me out on this:
  14.  
  15. 1) const int *p = 10;
  16.     p is a constant pointer to an int, right? While p can be made to
  17.     point to something else, *p can never be assigned to, right?
  18.  
  19. 2) int *const p;
  20.     p is a pointer to an integer.  *p can be assigned to, but p can
  21.     never be made to point to another address in memory, right?
  22.  
  23. 3) int const *p;
  24.     What the heck is this?  I can't find anything like this in my 
  25.     books, but my compiler thinks everything is hunky doory!???
  26.  
  27. Thank you for your time and consideration!
  28. Reed
  29. -- 
  30.     ____________________________________________________
  31.     \Reed R. Mangino     \  ** Dialogic Corporation **  \
  32.     / mangino@planet.net / World leader in the design of/
  33.     \ tornado@esu.edu    \  computer telephony systems  \
  34.